<script>
function cancel(oid){
	if(!confirm('確認要取消:'+oid)){
		return false;
	}
	$.post('<?php echo CHtml::normalizeUrl(array('/site/cancel'));?>',{'oid':oid}, function (data) {
        var ret = $.parseJSON(data);
        if (ret != null && ret.success != null && ret.success) {
			alert(ret.msg);
			location.reload(true);
        }
	});	
}
</script>
<div id="contener" _height="auto">
	<?php $this->beginWidget('application.widget.site.userLeftWidget'); ?>
	<?php $this->endWidget(); ?>
	<div class="main2">
		<?php $this->beginWidget('application.widget.site.newWidget'); ?>
		<?php $this->endWidget(); ?>
		<div class="right_mainBox">
			<div class="right_mainBox_top"></div>
			<div class="mainMenu"><img src="images/title26.png" width="726" height="23" alt="活動參與紀錄" title="活動參與紀錄" />
				<div class="memberBOX5" style="height:420px;">
					<form action="" method="post">
					<table width="720" border="0" align="center" cellpadding="0" cellspacing="3">
						<tr>
							<td width="50%"><?php echo CHtml::dropDownList('status',$search['status'], Yii::app()->params['orderstatus']);?></td>
							<td style="text-align:right;">訂單編號：<input type="text" name="oid" id="oid" value="<?=$search['oid']?>" /><input type="submit" name="button2" id="button2" value="查詢" /></td>
						</tr>
					</table>
					</form>
					<p class="a1">目前僅提供六個月內的交易資料，若您欲查詢六個月前的資料，請您與客服中心聯繫。</p>
					<table width="720" border="0" align="center" cellpadding="0" cellspacing="3" id="table2" style=" margin-top:20px;" >
						<tr>
							<th width="100">訂單編號</th>
							<th width="180">訂單時間</th>
							<th width="150">付款方式</th>
							<th width="90">訂單金額</th>
							<th width="100">處理狀態</th>
							<th width="100">操作</th>
						</tr>
						<?php
						if($rowset){
							foreach($rowset as $row){
						?>
						<tr>
							<td><?=$row->oid?></td>
							<td><?=$row->dateline?></td>
							<td><?=Yii::app()->params['paytype'][$row->pay_type]?></td>
							<td class="red1"><?=$row->total_final?></td>
							<td class="red1"><?=Yii::app()->params['orderstatus'][$row->status]?></td>
							<td><a href="<?=Yii::app()->createUrl('site/orderDetail',array('oid'=>$row->oid))?>" target="_blank">查看</a><?php if($row->status==1){?>&nbsp;&nbsp;<a href="###" onclick="cancel('<?=$row->oid?>')">取消</a><?php }?></td>
						</tr>
						<?php
							}
						?>
						<tr>
							<td style="text-align:center;" colspan="6">
							<?php  
							$this->widget('CLinkPager',array(  
								'header'=>'',  
								'firstPageLabel' => '<<',
								'lastPageLabel' => '>>',
								'prevPageLabel' => '<',
								'nextPageLabel' => '>',
								'pages' => $pages,  
								'maxButtonCount'=>13  
								));  
							?>
							</td>
						</tr>
						<?php
						}else{
						?>
						<tr>
							<td colspan="6">暫無記錄</td>
						</tr>
						<?php
						}
						?>
					</table>

				</div>
			</div>
			<div class="mainContentBox"> </div>
			<div class="right_mainBox_bottom"></div>
		</div>
	</div>
</div>
